package test0ne.设计模式.组合模式;

public abstract class Node {
    protected String name;

    public Node(String name) {
        this.name = name;
    }

    public abstract void add(Node child);

    public void ls(int space) {
        for (int i = 0; i < space; i++) {
            System.out.printf(" ");
        }
        System.out.println(this.name);
    }

    public void ls() {
        this.ls(0);
    }
}
